package com.twt.config;

import com.twt.sys.interceptor.LoginInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Slf4j
//@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.debug("Interceptor 注册开始====================》");
        LoginInterceptor loginInterceptor = new LoginInterceptor();
        loginInterceptor.addWithePath("/login");
        loginInterceptor.addWithePath("/dev/login");
        loginInterceptor.addWithePath("/sys/user/registrySysUser");


        loginInterceptor.addWithePath("/favicon.ico");
        registry.addInterceptor(loginInterceptor);
        log.debug("LoginInterceptor 注册成功.....");
        log.debug("Interceptor 注册结束====================》");
    }
}
